package com.adv.ems.controller.admin;

import com.adv.ems.model.dto.APIResponse;
import com.adv.ems.service.CacheService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

@RestController
@RequestMapping("/admin/cache")
public class CacheController {
    @Resource
    CacheService cacheService;

    @RequestMapping("/refresh")
    public APIResponse<Boolean> refresh() {
        cacheService.refreshCache();
        return APIResponse.<Boolean>build().content(true);
    }
}
